/**
 * 电子证照对接的js api
 */
import request from "@/utils/request";

// 获取电子证照预览或者下载地址详情
export function getElecLicenUrl(elecLicenOid, cityCode) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/elemLice/downloadLicenseByElecLicenOid?elecLicenOid=" +
      elecLicenOid +
      "&cityCode=" +
      cityCode,
    method: "post"
  });
}

// 获取电子证照信息
export function queryElecLicenseByDirCode(
  materialOid,
  userName,
  idCard,
  cityCode
) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/elemLice/queryElecLicenseByDirCode?materialOid=" +
      materialOid +
      "&userName=" +
      userName +
      "&idCard=" +
      idCard +
      "&cityCode=" +
      cityCode,
    method: "post"
  });
}

/**
 * 获取证照预览的前置地址ofd地址
 * @returns
 */
export function getViewUrl() {
  return process.env.VUE_APP_ELECLICEN_VIEW_PRE_URL;
}
